import CryptoJS from "crypto-js";

export function decrypt(keyStr, data){
  const key = CryptoJS.enc.Utf8.parse(keyStr);
  const srcs = CryptoJS.AES.decrypt(data, key, { mode: CryptoJS.mode.ECB, pad: CryptoJS.pad.Pkcs7 });
  const result = CryptoJS.enc.Utf8.stringify(srcs);
  return JSON.parse(result)
}